home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10716 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: grease.sms.co.uk!usenet
  2. From: Piers Scannell <piers@sms.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Problem: ERROR: Cannot convert 'const void * ' to ' const HBITMAP_* '
  5. Date: 7 Mar 1996 00:20:51 GMT
  6. Organization: Satellite Media Services
  7. Message-ID: <4hla53$qhg@grease.sms.co.uk>
  8. References: <4h9a8h$89i@neptunus.pi.net>
  9. NNTP-Posting-Host: caroline.sms.co.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
  14.  
  15. cat.tech@pi.net (Remy Cool) wrote:
  16.  
  17. >/* code as described in online help BitBlt function */
  18. >
  19. [sniped line]
  20.  > hbmpOld = SelectObject(hdcMemory, hbmpGraphic);    // >>> Line 98
  21.  
  22. >When I use this code in my program, I get the following Compiler Error.
  23. >
  24. >Error MyApp.CPP 98: Cannot convert 'const void *' to 'const HBITMAP__ *'
  25. >
  26.  
  27. short answer: cast to HBITMAP: 
  28.   hbmpOld = (HBITMAP) SelectObject(...
  29.  
  30. the cause is the way handles are defined in windows.h depending on 
  31. whether STRICT is defined; check out windows.h (search for HBITMAP 
  32. and work back - it's all clever stuff pretending what's just a word
  33. value is really a near pointer and stuff, which is probably there
  34. to cause precisely these kind of errors...
  35.  
  36.  
  37.